<?php
/**
 * Created by PhpStorm.
 * User: bill-h
 * Date: 2021/10/11
 * Time: 10:52
 * Email: 391878487@qq.com
 */
namespace app\api\middleware;
use app\Request;
use interfaces\MiddlewareInterface;

/**
 * 监测站点是否开启
 * Class StationOpenMiddleware
 * @package app\api\middleware
 */
class StationOpenMiddleware implements MiddlewareInterface
{
    public function handle(Request $request, \Closure $next)
    {
        if (config('app.station_open')!=1) {
            return app('json')->make('410010', '站点升级中，请稍候访问');
        }
        return $next($request);
    }
}